FROM golang:alpine

WORKDIR /go/src/advertapi
COPY . .

RUN go generate && go env && go build -o advertapi .

FROM alpine:latest
LABEL MAINTAINER="SliverHorn@sliver_horn@qq.com"

WORKDIR /go/src/advertapi

COPY --from=0 /go/src/advertapi ./

EXPOSE 9999

ENTRYPOINT ./ -c config.docker.yaml
